home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / netbsd / tools / binpatch-array-1.1.readme < prev    next >
Text File  |  1995-11-07  |  4KB  |  106 lines

  1. Descr:     Patch certain variables in the kernel to some user-defined
  2.     values. Handles arrays of variables. 
  3.         Recompiled for NetBSD 1.1 
  4. Author: Rob Leland, Markus Wild
  5. Uploader: Rob Leland <leland@freetocreate.cais.com>
  6.     
  7. The tools/binpatch-arr.tar.gz is a modified version of the binpatch
  8. array that I made about 2 year ago. Besides the usage outlined
  9. in the binpatch.readme file, it allows patching of arrays of variables
  10.  
  11. A man page can be had by typeing binpatch -HELP.
  12. A synopsis can gleamed by just typing binpatch.
  13.  
  14. -Rob leland@freetocreate.cais.com
  15.  
  16. ---------------------------------------------------------------------------
  17. binpatch -HELP:
  18. ~~~~~~~~~~~~~~
  19.  
  20. NAME
  21.     ./binpatch.bsdexe - Allows the patching of BSD binaries
  22. SYNOPSIS
  23.     ./binpatch.bsdexe [-HELP]
  24.     ./binpatch.bsdexe [-b|-w|-l] -s symbol[[[index]][=value]] binary 
  25.     ./binpatch.bsdexe [-b|-w|-l] [-o offset] -s symbol [-r value] binary
  26.     ./binpatch.bsdexe [-b|-w|-l] [-o offset] -a address [-r value] binary
  27. DESCRIPTION
  28.     Allows the patching of BSD binaries, for example,a distributed
  29.     kernel. Recient additions allows the user to index into an array
  30.     and assign a value. Binpatch has internal variables to allow
  31.     you to test it on itself under NetBSD.
  32. OPTIONS
  33.     -a  patch variable by specifying address in hex
  34.     -b  symbol or address to be patched is 1 byte
  35.     -l  symbol or address to be patched is 4 bytes  (default)
  36.     -o  offset to begin patching value relative to symbol or address
  37.     -r  replace value, and print out previous value to stdout
  38.     -s  patch variable by specifying symbol name. Use '[]'
  39.         to specify the 'index'. If '-b, -w or -l' not specified
  40.         then index value is used like an offset. Also can use '='
  41.         to assign value
  42.     -w  symbol or address to be patched is 2 bytes
  43. EXAMPLES
  44.     This should print 100 (this is a nice reality check...)
  45.         binpatch -l -s _hz vmunix
  46.     Now it gets more advanced, replace the value:
  47.         binpatch -l -s _scsi_debug -r 1 vmunix
  48.     Now patch a variable at a given 'index' not offset, 
  49.     under NetBSD you must use '', under AmigaDos CLI '' is optional.:
  50.         binpatch -w -s '_vieww[4]' -r 0 a.out
  51.     same as
  52.         binpatch -w -o 8 -s _vieww -r 0 a.out
  53.     Another example of using []
  54.         binpatch -s '_viewl[4]' -r 0 a.out
  55.     same as
  56.         binpatch -o 4 -s _viewl -r 0 a.out
  57.     One last example using '=' and []
  58.         binpatch -w -s '_vieww[4]=2' a.out
  59.     So if the kernel is not finding your drives, you could enable
  60.     all available debugging options, helping to shed light on that problem.
  61.         binpatch -l -s _scsi_debug -r 1 vmunix    scsi-level
  62.         binpatch -l -s _sddebug -r 1 vmunix    sd-level (disk-driver)
  63.         binpatch -l -s _acdebug -r 1 vmunix    autoconfig-level
  64. SEE ALSO
  65.     binpatch.c binpatch(1)
  66.  
  67.  
  68.  
  69.  
  70. binpatch.readme:
  71. ~~~~~~~~~~~~~~~~
  72. The binpatch utility allows you to patch your BSD binaries, for example,
  73. a distributed kernel. There's no man-page for it currently, these may
  74. serve as example, to go into details, read the source:
  75.  
  76. binpatch -l -s _hz vmunix
  77.      |   |  |
  78.     ^^^  | ^^^
  79.      a long  |  symbol name, "_hz" in this case
  80.         ^^^
  81.       you specify symbol (-a to specify address)
  82.  
  83. this should print 100 (this is a nice reality check...)
  84.  
  85. Other sizes available are -w: 2 byte, -b: 1 byte.
  86.  
  87. now it gets more advanced:
  88. binpatch -l -s _scsi_debug -r 1 vmunix
  89.  
  90. -r 1 says, replace the value found with 1. The previous value is printed
  91. to stdout, and the new value is set.
  92.  
  93. So if you have problems with the kernel not finding your
  94. drives, you could enable all available debugging options helping to
  95. shed light on that problem:
  96.  
  97. binpatch -l -s _scsi_debug -r 1 vmunix    scsi-level
  98. binpatch -l -s _sddebug -r 1 vmunix    sd-level (disk-driver)
  99. binpatch -l -s _acdebug -r 1 vmunix    autoconfig-level
  100.  
  101. Good luck!
  102.  
  103. -Markus Wild
  104.  
  105. PS: compile with gcc -I. binpatch.c nlist.c -o binpatch.
  106.